package com.nc.mem.serial.graph.common;

import java.nio.ByteBuffer;
import java.util.Date;

import com.nc.mem.serial.graph.GraphSerializer;
import com.nc.mem.serial.graph.Representation;


public class DateSerializer extends GraphSerializer{

	@Override
	public void doWrite(ByteBuffer dest, Object obj) {
		Representation.writeLong(dest, ((Date)obj).getTime());
	}

	@Override
	public void doRead(ByteBuffer src, Object obj) {
		
	}

	@Override
	public Object instantiate(ByteBuffer src) {
		return new Date(Representation.readLong(src));
	}

}
